/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PuBillVouch extends BasicModel<PuBillVouch> {
  djno?: string; // 单据号
  pkCorp?: string; // 公司主键
  venId?: string; // 供应商ID
  ddate?: string; // 单据日期
  itaxmoney?: number; // 价税合计
  itax?: number; // 税额
  imoney?: number; // 无税金额
  currtypename?: string; // 币种
  prtQty?: number; // 打印次数
  puBillVouchsList?: any[]; // 子表列表
}

export const puBillVouchList = (params?: PuBillVouch | any) =>
  defHttp.get<PuBillVouch>({ url: adminPath + '/srm/cw/billvouch/puBillVouch/list', params });

export const puBillVouchListData = (params?: PuBillVouch | any) =>
  defHttp.post<Page<PuBillVouch>>({
    url: adminPath + '/srm/cw/billvouch/puBillVouch/listData',
    params,
  });

export const puBillVouchForm = (params?: PuBillVouch | any) =>
  defHttp.get<PuBillVouch>({ url: adminPath + '/srm/cw/billvouch/puBillVouch/form', params });

export const puBillVouchSave = (params?: any, data?: PuBillVouch | any) =>
  defHttp.postJson<PuBillVouch>({
    url: adminPath + '/srm/cw/billvouch/puBillVouch/save',
    params,
    data,
  });

export const puBillVouchDelete = (params?: PuBillVouch | any) =>
  defHttp.get<PuBillVouch>({ url: adminPath + '/srm/cw/billvouch/puBillVouch/delete', params });

export const puBillVouchCalcMoney = (params?: PuBillVouch | any) =>
  defHttp.get<PuBillVouch>({ url: adminPath + '/srm/cw/billvouch/puBillVouch/calcMoney', params });
